<template>
    <div class="search_content">
        <div class="search_content_box">
            <el-input :placeholder="placeholder"  :prefix-icon="Search" v-model="searchInput"  class="inputClass"
                @keyup.enter.native="inputEnter"> </el-input>
            <el-divider direction="vertical"></el-divider>
            <!-- -->
            <slot></slot>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { Search } from "@element-plus/icons-vue"
defineProps({
    placeholder: {
        type: String,
        default: "搜索文件、文件夹",
    },
})

const searchInput = ref("")
const emit = defineEmits(["inputEnter"])
const inputEnter = () => {
    emit("inputEnter", searchInput.value)
}

</script>
<style scoped lang="scss">
:deep(.el-input__wrapper) {
    box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
    // background:#F8F8F8;
    cursor: default;
    .el-input__inner {
        cursor: default !important;
    }
}

.search_content {
    .search_content_box {
        display: flex;
        align-items: center;
        height: 48px;
        padding-right: 20px;
        margin-left: 20px;
        border-bottom: 1px solid #eee;

        .inputClass {
            width: 220px;

            :deep(.el-input__inner) {
                border: 0;
            }
        }

        .el-divider--vertical {
            margin: 0 10px;
        }
    }
}
</style>
